package com.woniuxy.controller;


import com.github.pagehelper.PageInfo;
import com.woniuxy.entity.RbacManager;
import com.woniuxy.entity.RbacPerm;
import com.woniuxy.entity.ResponseEntity;
import com.woniuxy.service.RbacPermService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author: wgt
 * Date: 2021/11/28:19:15
 * Description:
 */
@RequestMapping("/perm")
@RestController
public class RbacPermController {
    @Autowired
    RbacPermService rbacPermService;

    @RequestMapping("/findAll")
    public PageInfo<RbacPerm> findAll(@PathVariable int pageNum, @PathVariable int pageSize) {
        return rbacPermService.findAll(pageNum, pageSize);

    }

    @RequestMapping("/save")
    public ResponseEntity save(@RequestBody RbacPerm rbacPerm){

        return  rbacPermService.save(rbacPerm);

    }
    @RequestMapping("/delete")
    public ResponseEntity delete( int id){

        return  rbacPermService.deleteById(id);

    }
    @RequestMapping("/update")
    public ResponseEntity update(@RequestBody RbacPerm rbacPerm){

        return  rbacPermService.update(rbacPerm);

    }
}